<script type="text/javascript">
    var baseUrl = '<?php echo $this->baseUrl(); ?>';
</script> 
<?php 
    $cliente = $this->cliente;
    $ingreso = $this->ingreso;
?>
    <h3>
        <p style="text-height: max-size;"class="text-info">
            Datos de Ingresos:
            <?php echo $cliente->getApellido() . '&nbsp;&nbsp' . $cliente->getNombre(); ?>
        </p> 
    </h3>
 <form id="editar_sesion" name="editar_sesion" class="form-horizontal" method="Get" action="<?php echo $this->baseUrl("clientes/cliente/registrar/accion/tomarsesion") ?>">
    <legend>Editar Sesion: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sesion <?php echo count($ingreso->getSesiones()) + 1; ?> de <?php echo $ingreso->getCantidad(); ?>
    </legend> 
    <input class="hidden" type="text" id="editarsesion" name="editarsesion" value="editarSesion">
    <input class="hidden" type="text" id="cliente_id" name="cliente_id" value="<?php echo $this->cliente_id; ?>">
    <input class="hidden" type="text" id="ingreso_id" name="ingreso_id" value="<?php echo $this->ingreso_id; ?>">
    <table>
     <?php //echo $sesion->getId().'sesion id'; ?>
        <tbody>
        
        <tr>
            <td>
                <div class="control-group">
                    <label class="control-label">Tipo Sesion</label>
                    <div class="controls input-medium">
                        <select id="tipo_sesion" name="tipo_sesion">
                            <option value="">Seleccione opción..</option>
                            <?php foreach ($this->tiposSesiones as $tipoSesion): ?>
                                <option value="<?php echo $tipoSesion->getId(); ?>"><?php echo $tipoSesion->getDescripcion(); ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>
            </td>
            <td>
                <div class="control-group">
                    <label class="control-label">Dif Monto</label>
                    <div class="controls input-small">
                        <input class="input-small" type="text" id="text_dif_monto" name="text_dif_monto" placeholder="Dif Monto" value="<?php echo 0;?>">
                    </div>
                </div>
            </td>
            <td>
                <div class="control-group" style="margin-left: -30px;">
                    <label class="control-label">Fecha</label>
                    <div class="controls">
                        <input class="input-small datepicker" type="text" id="fecha_sesion" name="fecha_sesion" placeholder="Fecha">
                    </div>
                </div>
            </td>
            <td>
                <div class="control-group">
                    <div class="controls input-small">
                        <input style="margin-left: -70px;" class="btn btn-primary " type="submit" name="tomarsesion" value="Tomar Sesion"> 
                    </div>
                </div>
            </td>
        </tr>
        </tbody>
  </table>
     
</form>

<script type="text/javascript">
     $(document).ready(function(){ 
        $( ".datepicker" ).datepicker({dateFormat: 'dd/mm/yy',changeMonth:true,changeYear:true});
        $("#editar_sesion").validate({
        ignoreTitle: true,
        errorPlacement: false,
        rules: {
            /* personal cliente */
            tipo_sesion: {required: true},
            text_dif_monto: {required: true},
            fecha_sesion: {required: true}
        },
        highlight: function(element, errorClass) {
            $(element).attr('style', 'border:1px solid red; background-color:#FF7373; color:black;');
        },
        unhighlight: function(element, errorClass, validClass) {
            $(element).attr("style", "");
        },
        errorPlacement: function(error, element) {
        }
    });
    });
</script>
